#include <stdio.h>
#include <stdlib.h>
typedef struct hashl
{
	int data;
	struct hashl *next;
}hashnode;

hashnode *creatlink(void);
int hashinsert(hashnode *H,int num);
int findfun(hashnode *H,int num);

int main(int argc, const char *argv[])
{
	int arr[12]={7,5,15,53,64,77,85,12,1,29,23,22};
	hashnode *hashlink[16];	
	int mynum;
	int i=0;
	for(i=0;i<16;i++)
	{
		hashlink[i]=creatlink();
	}
	
	for(i=0;i<12;i++)
	{
		hashinsert(hashlink[arr[i]%16],arr[i]);
	}

	printf(">>plz input num\n");
	printf(">> ");
	scanf("%d",&mynum);
	
	int flag=findfun(hashlink[mynum%16],mynum);
	if(flag==0)
	{
		printf("good\n");
	}
	else
	{
		printf("no\n");
	}
	return 0;
}

hashnode *creatlink(void)
{
	hashnode *H=(hashnode *)malloc(sizeof(hashnode));

	H->data=0;
	H->next=NULL;

	return H;
}

int hashinsert(hashnode *H,int num)
{
	hashnode *p=(hashnode *)malloc(sizeof(hashnode));
	p->data=num;
	p->next=H->next;
	H->next=p;

	return 0;
}

int findfun(hashnode *H,int num)
{
	while(H->next!=NULL)
	{
		H=H->next;
		if(H->data==num)
		{
			return 0;
		}
	}
	return -1;
}
